POV-Ray : Newsgroups : moray.win : Animation question : Re: Animation question Server Time
27 Apr 2024 12:48:31 EDT (-0400)
  Re: Animation question  
From: Stefan Persson
Date: 10 Apr 2005 21:57:11
Message: <4259d977$1@news.povray.org>
To expand my theory..

#declare c=0;  ;Declare the counter
#declare OnOff = 0; ;Declare the boolean variable

code code..

#if(c<=11) ;Check if we reached the end of the light cycle. If we are still
within 0-11 then do nothing except..
    c=c+1; ;..increment the counter
#else ;We have reached the end of the light cycle
    #if(OnOff=0) ;Check if the light was on or off
        OnOff=1;
    #else
        OnOff=0;
    #end
    c=0; ;IMPORTANTE!! Reset the counter so that we reset the cycle..
#end

code code..

#lightsomething..
    #if(OnOff=1) ;If 1 then the light is on.. if not.. just do nothing..
            light_source {   // Strobe light
          <0.0, 0.0, 0.0>
          color rgb <1.000, 1.000, 1.000>
          translate  <0.985, -9.983, 15.82>
           }
    #end
#end

Code.. code..

Or something like that..

Stefan

"Stefan Persson" <azy### [at] teliacom> skrev i meddelandet
news:4259d638$1@news.povray.org...
> Hi Dave,
> And so you shouldn't.. ;)
>
> For the propeller I would use some sort of semi-transparent texture
> to fake the motion blur of the spinning.
> For the strobe, I can think of a solution..
>
>         A counter that holds the duration of the on/off sequense
>         + a boolean variable.
>         Let's say you want the light to be on for half a second
>         (that's something like 12 frames.. 24 fps/2). Then the
>         counter increments itself 12 times. When it reaches
>         12 or 11, depending on if you start on 0 or 1, it switches
>         the boolean.
>         The light checks every cycle if the boolean is true or
>         false. If it's true, it's on.. and the opposite of course.
>
> Try it. I hold no responsibility if it does any harm to
> animals or your computer.. ;)
>
> Stefan
>
> "dj" <djh### [at] msncom> skrev i meddelandet
> news:web.42529207d94d7e8f63b34e470@news.povray.org...
> > I have a quick (hopefully) question about animation. I'm trying to
animate
> a
> > flying aircraft.  I need to animate some strobe lights flashing and a
> > propeller spinning.  Is there a way to animate small segments and have
> them
> > repeat?  I'd rather not have to manually animate the strobe light
flashing
> > through the entire sequence.
> >
> > Thanks,
> > Dave
> >
> >
>
>


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.